import hashlib
import socketserver模块


def get_md5(code, randseq):
    md5 = hashlib.md5(code)
    md5.update(randseq)
    res = md5.hexdigest()
    return res

sk = socketserver模块.socket()
sk.connect(('127.0.0.1', 9000))
code = b'jackbigdick'
randseq = sk.recv(32)
ret = get_md5(code, randseq)
sk.send(ret.encode('utf-8'))

sk.close()